#! /bin/sh
## use susynlv to make synthetic data
susynlv nt=501 dt=0.004 ft=0.0 nxo=2 \
	nxs=100 dxs=.025 dxo=.15 fxo=0.025 er=0 ob=0 \
	v00=2.0 dvdz=0 dvdx=0 fpeak=30 smooth=1 \
	ref="2:-.5,.45;3.,.45" \
	ref="2:-.5,.75;3.,.75" \
	ref="4:-.5,1.15;3.,1.15" \
	ref="6:-.5,1.65;3.,1.65" \
sushw key=d2 a=.05 >susyn.out

# window synthetic data
suwind <susyn.out >susyn.co025 key=offset min=025 max=025
suwind <susyn.out >susyn.co175 key=offset min=175 max=175

sushw <susyn.co025 >susyn.co025.geom key=cdp a=1 b=1 c=1 
sushw <susyn.co175 >susyn.co175.geom key=cdp a=1 b=1 c=1

# apply offset continuation
sunmo <susyn.co175.geom |
suocext cdpmin=1 cdpmax=100 dxcdp=25 noffmix=1 offextr=25 vdmo=2000. |
sunmo >susyn.fo025 inver=1

# take difference between model data and offset continued data
suop2 susyn.co025.geom susyn.fo025 op=diff >susyn.diff

supsimage <susyn.co025 label1="Time [s]" label2="Trace #" 
	d1num=.2 d2num=10  n1=501 n2=100 d1=.004 \
	d2=1 f1=0 f2=1 clip=30.  title="Common-offset 25m" \
	perc=99.5 >susyn.co025.ps 

supsimage <susyn.co175  \
        label1="Time [s]" label2="Trace #" d1num=.2 d2num=10 \
	n1=501 n2=100 d1=.004 d2=1 f1=0 f2=1 clip=30. \
	title="Common-offset 175m"  perc=99.5 >susyn.co175.ps

supsimage <susyn.fo025 \
	label1="Time [s]" label2="Trace #"  d1num=.2 d2num=10 \
	n1=501 n2=100 d1=.004 d2=1 f1=0 f2=1 clip=30. \
	title="Extrapolated-offset 25m"  perc=99.5 >susyn.fo025.ps 

supsimage <susyn.diff \
        label1="Time [s]" label2="Trace #" d1num=.2 d2num=10 \
	n1=501 n2=100 d1=.004 d2=1 f1=0 f2=1 clip=30. \
	title="Difference (modeled - extrapolated)"  perc=99.5 >susyn.diff.ps 

merge4 susyn.co025.ps susyn.co175.ps susyn.fo025.ps susyn.diff.ps >m4.susyn.ps

echo "You may now view the file m4.susyn.ps with your PostScript previewer"
exit 0
